Hypertext Transfer Protocol Server Library  
 

Embed a web server in your application to provide access to documents and other resources over HTTP or HTTPS. The library handles standard requests and provides events for customizing server behavior, along with support for CGI scripting, virtual hosting, and client authentication.

Reference

Library Information

File Name CSHTSV12.DLL
Version 12.0.3041.1380
LibID 25AA25CC-886B-4CFD-8089-96B70CAC2169
Import Library CSHTSV12.LIB
Dependencies None
Standards RFC 1945, RFC 2616, RFC 3875

Overview

The Hypertext Transfer Protocol Server library enables applications to host an embedded web server that provides documents and other resources to browsers and HTTP clients. The application configures the server and handles events generated by incoming connections and requests. Default processing is available for standard HTTP operations, allowing applications to serve content without implementing the protocol exchange themselves.

Applications can use request events to inspect the requested resource, URL, query parameters, and headers. When custom handling is required, the application has access to the request data and can specify the response, with additional functions for sending response data, modifying headers, redirecting requests, and returning customized errors. This allows application-specific behavior alongside the server's default processing, which is recommended for standard operations where no customization is needed.

Virtual hosting functions allow applications to configure multiple host names and aliases, while virtual path mappings control how resources are exposed within each host. Virtual users, client authentication functions, and access rights provide control over protected resources. Applications can check permissions for a virtual path, require authentication, and translate between virtual paths and local file system paths.

CGI support allows applications to associate programs with virtual paths or file name extensions. Functions expose CGI environment variables and provide access to a program's output and exit code, allowing the host application to coordinate external processing with server activity. Together with custom request handling, these capabilities support both file-based content and responses generated for a particular request.

Server management functions start, stop, restart, suspend, and resume the service. Applications can enumerate connected clients, inspect session information, adjust idle timeouts, and disconnect individual clients. Throttling controls limit active connections, connections per address, and connection rates. Secure connections use TLS 1.2 or later and require a valid security certificate installed on the system. Server logs, transfer information, memory usage, error reporting, and optional network tracing support monitoring and troubleshooting.

This library uses multiple worker threads to manage client connections and requests. Events are raised in the context of the worker thread processing the corresponding client session, allowing activity for multiple clients to be processed concurrently. Blocking or lengthy processing within an event handler may delay further processing for that client, but does not prevent other worker threads from continuing to process their client sessions.

Applications should be aware that event handlers do not necessarily execute on the thread that created the server instance. Event handlers that access global or shared data must provide appropriate synchronization. This is particularly important for applications with a graphical user interface, because user interface components generally expect to be accessed from the thread that created them. An event handler executing on a worker thread should not directly update the application's user interface or assume that it is executing on the main UI thread. If an event handler needs to interact with UI components or other resources that have thread affinity, the application is responsible for marshaling that activity to the appropriate thread, such as by posting a message to the UI thread.

Requirements

The SocketTools Library Edition is compatible with any programming language that can call functions exported from a standard Windows DLL. If you are using Visual Studio, the minimum supported version is Visual Studio 2010 with Service Pack 1 (SP1). The header files are compatible with modern C/C++ compilers, and function declarations are provided for several other languages. We recommend installing the latest updates for your development tools and the Windows SDK.

SocketTools supports Windows 7 SP1, Windows Server 2008 R2 SP1, and later desktop and server versions of Windows, with Windows 8.1 as the minimum supported version for Windows 8-based systems. Both 32-bit and 64-bit Windows platforms are supported for application development. Windows on ARM requires Windows 10 build 1709 or later. We recommend using a version of Windows that is currently supported by Microsoft for application development.

SocketTools provides 32-bit x86, 64-bit x64, and native ARM64 libraries. The x86 libraries maintain compatibility with legacy development tools and can run under emulation on Windows on ARM. Native ARM32 applications are not supported because Microsoft discontinued support for 32-bit ARM applications in Windows.

For native ARM64 development, we recommend Visual Studio 2019 or later. Some development tools, including recent versions of Embarcadero Delphi, support Windows on ARM using the ARM64EC architecture. ARM64EC applications can use x64 DLLs through emulation, but cannot load native ARM64 DLLs. Developers targeting ARM64EC should use the SocketTools x64 libraries rather than the native ARM64 libraries.

Import libraries are provided in COFF format for x86, x64, and ARM64 platforms. OMF libraries are also provided for x86, and ELF libraries for x64, to support older Borland and Embarcadero compilers. Visual Studio developers should use the standard COFF libraries. Some programming languages can call exported DLL functions directly without requiring an import library.

Distribution

When distributing an application that uses this library, we recommend installing the SocketTools DLL in the same folder as the application executable. This simplifies deployment and avoids potential conflicts with other applications that use different versions of the library. The DLL must be compatible with the application's processor architecture (x86, x64, or ARM64). If the library is installed in a shared system location, the installer should manage it as a shared DLL to prevent other applications from being affected when it is updated or removed. SocketTools libraries are standard Windows DLLs, not ActiveX components, and do not require COM registration.

This library has no external runtime dependencies beyond the standard Windows system libraries. It does not require the Microsoft Visual C++ Redistributable or any additional third-party libraries to be installed. All required components are either provided by Windows or statically linked into the SocketTools DLLs, simplifying deployment and eliminating the need to distribute additional runtime files.